package com.xizimall.controller;

import javax.swing.text.DefaultEditorKit.InsertContentAction;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * 内容管理Controller
 * <p>Title: ContentController</p>
 * <p>Description: </p>
 * <p>华南理工大学研究生</p> 
 * @author	李隆熹
 * @date	2018年4月18日下午6:46:26
 * @version 1.0
 */
import org.springframework.web.bind.annotation.ResponseBody;

import com.xizimall.pojo.TbContent;
import com.xizimall.service.ContentService;
import com.xizimall.common.pojo.EUDataGridResult;
import com.xizimall.common.pojo.XizimallResult;
@Controller
public class ContentController {
   @Autowired
   private ContentService contentService;
   @RequestMapping("/content/query/list")
   @ResponseBody
   public EUDataGridResult getContentList(int page,int rows ,Long categoryId){
	   EUDataGridResult result=contentService.getContentList(page, rows, categoryId);
	   return result;
   }
   @RequestMapping("/content/save")
   @ResponseBody
   public XizimallResult insertContent(TbContent content){
	   XizimallResult result=contentService.insertContent(content);
	   return result;
   }
   @RequestMapping("/rest/content/edit")
   @ResponseBody
   public XizimallResult updateContent(TbContent content){
	   XizimallResult result=contentService.editContent(content);
	   return result;
   }
   
}
